<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const p1 = () => {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          console.log('p1触发了');
          resolve('a')
        }, 1000)
      })
    }
    const p2 = () => {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          console.log('p2触发了');
          resolve('b')
        }, 500)
      })
    }
    const p3 = () => {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          console.log('p3触发了');
          resolve('c')
        }, 1500)
      })
    }

    const test = async () => {
      try {
        await p1()
        await p1()
        await p1()
      } catch (error) {
        console.log(error);
      }

    }
    test()
  </script>
</body>

</html>